Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Node / ReticulumProjects / MeshChatX.git / files / scripts / build-macos-universal.sh

Displaying Raw • Download


scripts/build-macos-universal.sh v4.5.0-rc.2 (1394a44a) Text, 1.57 KB

T8b949e#!/usr/bin/env bash
T8b949e# Build darwin-arm64 and darwin-x64 cx_Freeze backends, then electron-builder --mac --universal.
T8b949e# On Apple Silicon, the x64 backend must be built with an x86_64 Python (e.g. Homebrew in /usr/local).
T8b949e# Set PYTHON_CMD_X64 to that interpreter if Poetry's default env is arm64-only.
Tffa657set -euo pipefail

Te6edf3ROOTTff7b72=Ta5d6ff"Tff7b72$(Tffa657cd Ta5d6ff"Tff7b72$(dirname Ta5d6ff"Te6edf3$0Ta5d6ff"Tff7b72)Ta5d6ff/..Ta5d6ff" Tff7b72&& Tffa657pwdTff7b72)Ta5d6ff"
Tffa657cd Ta5d6ff"Te6edf3$ROOTTa5d6ff"

T8b949e# @electron/universal merges x64 and arm64 app bundles and requires every non-binary
T8b949e# file present in both trees to have identical bytes. Per-arch backend-manifest.json
T8b949e# contents always differ, so skip embedding it here; electron/main.js treats a missing
T8b949e# manifest as "skip integrity check" (see verifyBackendIntegrity).
Tffa657export Te6edf3MESHCHATX_SKIP_BACKEND_MANIFESTTff7b72=T79c0ff1

pnpm run electron-postinstall
pnpm run version:sync
pnpm run build-frontend
cross-env Te6edf3ARCHTff7b72=arm64 pnpm run build-backend
Tff7b72if Tff7b72[Tff7b72[ -n Ta5d6ff"Tffd700${Te6edf3PYTHON_CMD_X64Tff7b72:-Tffd700}Ta5d6ff" Tff7b72]Tff7b72]Tb4b4b4; Tff7b72then
cross-env Te6edf3ARCHTff7b72=x64 Te6edf3PYTHON_CMDTff7b72=Ta5d6ff"Te6edf3$PYTHON_CMD_X64Ta5d6ff" pnpm run build-backend
Tff7b72else
cross-env Te6edf3ARCHTff7b72=x64 pnpm run build-backend
Tff7b72fi

T8b949e# @electron/universal v2.x checks SHA equality for every non-Mach-O file
T8b949e# and throws if any differ (no x64ArchFiles escape for PLAIN files).
T8b949e# cx_Freeze's library.zip contains only architecture-independent Python
T8b949e# bytecode; the per-arch native extensions (.dylib/.so) live outside the
T8b949e# zip. The two zips differ solely in .pyc header timestamps and zip
T8b949e# metadata, so copying one over the other is safe and makes the merge pass.
bash scripts/unify-backend-plain-files.sh

Tffa657exec pnpm Tffa657exec electron-builder --mac --universal --publishTff7b72=never


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────